import numpy as np
class Loss:
    def __init__(self,loss,loss_prime):
        self.loss = loss
        self.loss_prime = loss_prime

class MSE(Loss):
    def __init__(self):
        loss = lambda y_true,y_pred: np.mean(np.power(y_true - y_pred, 2))
        loss_prime = lambda y_true,y_pred: 2 * (y_pred - y_true) / np.size(y_true)
        super().__init__(loss,loss_prime)